package org.kjtc;

import org.junit.runner.RunWith;
import org.kjtc.redis.RedisUtil;
import org.kjtc.weChatUtil.CommonUtil;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;


/**
 * Created by Administrator on 2019/3/7 0007.
 */
@RunWith(SpringRunner.class)
@SpringBootTest
public class creatMune {
    @Autowired
    private RedisUtil redisUtil;


    @org.junit.Test
    public void creatMuneStart(){
        String a = "{\n" +
                "  \"button\": [\n" +
                "    {\n" +
                "      \"type\": \"view\",\n" +
                "      \"name\": \"地图找站\",\n" +
                "      \"url\": \"http://xiaokejia.4kb.cn/WeChat/mapPile\"\n" +
                "    },\n" +
                "    {\n" +
                "      \"name\": \"充电服务\",\n" +
                "      \"sub_button\": [\n" +
                "        {\n" +
                "          \"type\": \"view\",\n" +
                "          \"name\": \"扫码\",\n" +
                "          \"url\": \"http://www.baidu.com/\"\n" +
                "        },\n" +
                "        {\n" +
                "          \"type\": \"miniprogram\",\n" +
                "          \"name\": \"充电状态\",\n" +
                "          \"url\": \"http://mp.weixin.qq.com\",\n" +
                "          \"appid\": \"wx286b93c14bbf93aa\",\n" +
                "          \"pagepath\": \"pages/lunar/index.html\"\n" +
                "        },\n" +
                "        {\n" +
                "          \"type\": \"click\",\n" +
                "          \"name\": \"充电帮助\",\n" +
                "          \"key\": \"V1001_GOOD\"\n" +
                "        }\n" +
                "      ]\n" +
                "    }\n" +
                "  ]\n" +
                "}";
        String accessToken =  redisUtil.get("accessToken:temporaryKey").toString();
            //String accessToken = "19_gf3Ngw46xn1_ZaGS6YkDudvYXrb9K3medUCiObrfDAUyq0Ih8XTUOzTUN30Wpv57-u3Ral5Hhw62jI4uN-FXpr7IqiMjgYR5MFFQD_3Ib2VizIJjSFTNUZevnGYsGrB9K3aX8lwx9cvvt8OmJCUjABADWO";

            CommonUtil.createMenu(a,accessToken);




}
}
